# Proceed from Alpha to Beta, turn around using the turntable and return to Beta then Alpha.
# This train is started by a linking from "Out and Back 1".

Wait for 10 seconds
Assign short address 999 as Commuter in B-Alpha

Set turntable TUR2 on panel YAAT3 Demo to ray 1

# Move from Alpha to Beta
Set function key 0 on
Set direction to forward
Set speed to .5

    If sensor SimMode is active
        Wait for 2 seconds
        Set sensor B-Middle active
        Wait for 2 seconds
        Set sensor B-Alpha inactive
        Wait for 2 seconds
        Set sensor B-Beta active
        Wait for 2 seconds
        Set sensor B-Middle inactive
    Endif

Wait for sensor B-Beta to become active
Wait for sensor B-Middle to become inactive

Set speed to 0
Wait for 10 seconds

# Move from Beta to the turntable
Set speed to .2

    If sensor SimMode is active
        Wait for 2 seconds
        Set sensor B-T2-270 active
        Wait for 2 seconds
        Set sensor B-Beta inactive
        Wait for 2 seconds
        Set sensor B-T2 active
        Wait for 2 seconds
        Set sensor B-T2-270 inactive
    Endif

Wait for sensor B-T2 to become active
Wait for sensor B-T2-270 to become inactive

Set speed to 0
Wait for 1 second

Set turntable TUR2 on panel YAAT3 Demo to ray 0
Wait for 5 seconds

# Return to Beta
Set speed to .2

    If sensor SimMode is active
        Wait for 2 seconds
        Set sensor B-T2-270 active
        Wait for 2 seconds
        Set sensor B-T2 inactive
        Wait for 2 seconds
        Set sensor B-Beta active
        Wait for 2 seconds
        Set sensor B-T2-270 inactive
    Endif

Wait for sensor B-Beta to become active
Wait for sensor B-T2-270 to become inactive

Set speed to 0
Wait for 10 seconds

# Proceed to Alpha

Set speed to .5

    If sensor SimMode is active
        Wait for 2 seconds
        Set sensor B-Middle active
        Wait for 2 seconds
        Set sensor B-Beta inactive
        Wait for 2 seconds
        Set sensor B-Alpha active
        Wait for 2 seconds
        Set sensor B-Middle inactive
    Endif

Wait for sensor B-Alpha to become active
Wait for sensor B-Middle to become inactive

Set speed to 0
Set function key 0 off
Release throttle
Wait for 10 seconds

# Start the next train
Set memory YAAT Train to Out and Back 3.txt

Halt







